
//        Highlight rows when mouse ticks inputs
function highlight_row(rows) {
    if(rows.parentNode.parentNode.style.backgroundColor != 'yellow') {
    rows.parentNode.parentNode.style.backgroundColor = 'gray';
    rows.parentNode.parentNode.style.color = 'black';
    } else {
    rows.parentNode.parentNode.style.backgroundColor = 'white';
    }
}
//        change color row when mouse hover
function set_hover(rows) {
    if(rows.style.backgroundColor != 'yellow') {
    rows.style.backgroundColor = 'gray';
    rows.style.color = 'white';
    }
}
//        Change color row when mouse moves out
function remove_hover(rows) {
    if(rows.style.backgroundColor != 'pink') {
    rows.style.backgroundColor = 'white';
    rows.style.color = 'black';
    }
}

//Ham rut gon chuoi

    String.prototype.trunc =
    function(n,useWordBoundary){
        var toLong = this.length>n,
        s_ = toLong ? this.substr(0,n-1) : this;
        s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_;
        return  toLong ? s_ + '&hellip;' : s_;
        };

//    Ham chuyen tien te
        function formatCurency(n) {
            return n.toFixed(0).replace(/./g, function(c, i, a) {
            return i > 0 && c !== "." && (a.length - i) % 3 === 0 ? "," + c : c;
            });
        }